using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using TinyERP.Framework;
using TinyERP.Framework.Controls;
using TinyERP.Framework.Validation;

using TinyERP.Core.Business;
using TinyERP.Core.DTO;
using log4net;

namespace TinyERP.Core.View
{
    public class UserEditInfoForm : BasicEditInfoDialog
    {
        private ILog logger = LogManager.GetLogger(typeof(UserEditInfoForm));
        private const string FAKE_PASSWORD = "******";
		private UserDTO user = new UserDTO();
		private KLabel lblUserName;
		private TextBox txtUserName;
		private KLabel lblPassword;
		private TextBox txtPassword;
		private KLabel lblFullName;
		private TextBox txtFullName;
		private KLabel lblAddress;
        private TextBox txtAddress;
		private TextBox txtPhone;
        private KLabel lblBirthdate;
		private TextBox txtEmail;
		private KLabel lblBirthday;
		private DateTextBox dtBirthday;
		private KLabel lblUserGroup;
		private ComboBox cbUserGroup;
		private KLabel lblDepartment;
		private ComboBox cbDepartment;
        
        private KCheckBox chkChangePassword;
        private KLabel lblEmail;
        private KLabel kLabel1;
    
		public UserDTO User
		{
			get 
			{
				return user;
			}
			set 
			{
				user = value;
			}
		}
		public IUserService UserService 
		{
			get
			{
				return (IUserService) ServiceLocator.GetService("UserServiceProxy");
			}
		}
		public IUserGroupService UserGroupService 
		{
			get 
			{
				return (IUserGroupService) ServiceLocator.GetService("UserGroupServiceProxy");
			}
		}	
		public IDepartmentService DepartmentService 
		{
			get 
			{
				return (IDepartmentService) ServiceLocator.GetService("DepartmentServiceProxy");
			}
		}	
		
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.lblUserName = new TinyERP.Framework.Controls.KLabel();
            this.txtUserName = new System.Windows.Forms.TextBox();
            this.lblPassword = new TinyERP.Framework.Controls.KLabel();
            this.txtPassword = new System.Windows.Forms.TextBox();
            this.lblFullName = new TinyERP.Framework.Controls.KLabel();
            this.txtFullName = new System.Windows.Forms.TextBox();
            this.lblAddress = new TinyERP.Framework.Controls.KLabel();
            this.txtAddress = new System.Windows.Forms.TextBox();
            this.txtPhone = new System.Windows.Forms.TextBox();
            this.lblBirthdate = new TinyERP.Framework.Controls.KLabel();
            this.txtEmail = new System.Windows.Forms.TextBox();
            this.lblBirthday = new TinyERP.Framework.Controls.KLabel();
            this.dtBirthday = new TinyERP.Framework.Controls.DateTextBox();
            this.lblUserGroup = new TinyERP.Framework.Controls.KLabel();
            this.cbUserGroup = new System.Windows.Forms.ComboBox();
            this.lblDepartment = new TinyERP.Framework.Controls.KLabel();
            this.cbDepartment = new System.Windows.Forms.ComboBox();
            this.chkChangePassword = new TinyERP.Framework.Controls.KCheckBox();
            this.lblEmail = new TinyERP.Framework.Controls.KLabel();
            this.kLabel1 = new TinyERP.Framework.Controls.KLabel();
            this.contentPanel.SuspendLayout();
            this.SuspendLayout();
            // 
            // buttonPanel
            // 
            this.buttonPanel.Location = new System.Drawing.Point(0, 208);
            this.buttonPanel.Size = new System.Drawing.Size(725, 30);
            // 
            // contentPanel
            // 
            this.contentPanel.Controls.Add(this.kLabel1);
            this.contentPanel.Controls.Add(this.lblEmail);
            this.contentPanel.Controls.Add(this.chkChangePassword);
            this.contentPanel.Controls.Add(this.lblUserName);
            this.contentPanel.Controls.Add(this.txtUserName);
            this.contentPanel.Controls.Add(this.lblPassword);
            this.contentPanel.Controls.Add(this.txtPassword);
            this.contentPanel.Controls.Add(this.lblFullName);
            this.contentPanel.Controls.Add(this.txtFullName);
            this.contentPanel.Controls.Add(this.lblAddress);
            this.contentPanel.Controls.Add(this.txtAddress);
            this.contentPanel.Controls.Add(this.txtPhone);
            this.contentPanel.Controls.Add(this.lblBirthdate);
            this.contentPanel.Controls.Add(this.txtEmail);
            this.contentPanel.Controls.Add(this.lblBirthday);
            this.contentPanel.Controls.Add(this.dtBirthday);
            this.contentPanel.Controls.Add(this.lblUserGroup);
            this.contentPanel.Controls.Add(this.cbUserGroup);
            this.contentPanel.Controls.Add(this.lblDepartment);
            this.contentPanel.Controls.Add(this.cbDepartment);
            this.contentPanel.Size = new System.Drawing.Size(725, 208);
            // 
            // lblUserName
            // 
            this.lblUserName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblUserName.Location = new System.Drawing.Point(13, 16);
            this.lblUserName.Name = "lblUserName";
            this.lblUserName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblUserName.ResourceKey = "";
            this.lblUserName.ResourceModuleKey = "UserName, TinyERP.Core";
            this.lblUserName.Size = new System.Drawing.Size(69, 20);
            this.lblUserName.TabIndex = 0;
            this.lblUserName.Text = "User name";
            this.lblUserName.Values.ExtraText = "";
            this.lblUserName.Values.Image = null;
            this.lblUserName.Values.Text = "User name";
            // 
            // txtUserName
            // 
            this.txtUserName.Location = new System.Drawing.Point(116, 16);
            this.txtUserName.Name = "txtUserName";
            this.txtUserName.Size = new System.Drawing.Size(266, 20);
            this.txtUserName.TabIndex = 1;
            // 
            // lblPassword
            // 
            this.lblPassword.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblPassword.Location = new System.Drawing.Point(425, 16);
            this.lblPassword.Name = "lblPassword";
            this.lblPassword.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblPassword.ResourceKey = "";
            this.lblPassword.ResourceModuleKey = "Password, TinyERP.Core";
            this.lblPassword.Size = new System.Drawing.Size(62, 20);
            this.lblPassword.TabIndex = 0;
            this.lblPassword.Text = "Password";
            this.lblPassword.Values.ExtraText = "";
            this.lblPassword.Values.Image = null;
            this.lblPassword.Values.Text = "Password";
            // 
            // txtPassword
            // 
            this.txtPassword.Enabled = false;
            this.txtPassword.Location = new System.Drawing.Point(503, 16);
            this.txtPassword.Name = "txtPassword";
            this.txtPassword.PasswordChar = '*';
            this.txtPassword.Size = new System.Drawing.Size(219, 20);
            this.txtPassword.TabIndex = 2;
            this.txtPassword.Text = "******";
            // 
            // lblFullName
            // 
            this.lblFullName.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblFullName.Location = new System.Drawing.Point(13, 41);
            this.lblFullName.Name = "lblFullName";
            this.lblFullName.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblFullName.ResourceKey = "";
            this.lblFullName.ResourceModuleKey = "FullName, TinyERP.Core";
            this.lblFullName.Size = new System.Drawing.Size(63, 20);
            this.lblFullName.TabIndex = 0;
            this.lblFullName.Text = "Full name";
            this.lblFullName.Values.ExtraText = "";
            this.lblFullName.Values.Image = null;
            this.lblFullName.Values.Text = "Full name";
            // 
            // txtFullName
            // 
            this.txtFullName.Location = new System.Drawing.Point(116, 42);
            this.txtFullName.Name = "txtFullName";
            this.txtFullName.Size = new System.Drawing.Size(266, 20);
            this.txtFullName.TabIndex = 3;
            // 
            // lblAddress
            // 
            this.lblAddress.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblAddress.Location = new System.Drawing.Point(13, 68);
            this.lblAddress.Name = "lblAddress";
            this.lblAddress.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblAddress.ResourceKey = "";
            this.lblAddress.ResourceModuleKey = "Address, TinyERP.Core";
            this.lblAddress.Size = new System.Drawing.Size(54, 20);
            this.lblAddress.TabIndex = 0;
            this.lblAddress.Text = "Address";
            this.lblAddress.Values.ExtraText = "";
            this.lblAddress.Values.Image = null;
            this.lblAddress.Values.Text = "Address";
            // 
            // txtAddress
            // 
            this.txtAddress.Location = new System.Drawing.Point(116, 68);
            this.txtAddress.Multiline = true;
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Size = new System.Drawing.Size(606, 39);
            this.txtAddress.TabIndex = 4;
            // 
            // txtPhone
            // 
            this.txtPhone.Location = new System.Drawing.Point(116, 113);
            this.txtPhone.Name = "txtPhone";
            this.txtPhone.Size = new System.Drawing.Size(266, 20);
            this.txtPhone.TabIndex = 5;
            // 
            // lblBirthdate
            // 
            this.lblBirthdate.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblBirthdate.Location = new System.Drawing.Point(16, 141);
            this.lblBirthdate.Name = "lblBirthdate";
            this.lblBirthdate.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblBirthdate.ResourceKey = "Birthdate";
            this.lblBirthdate.ResourceModuleKey = "TinyERP.Core";
            this.lblBirthdate.Size = new System.Drawing.Size(6, 2);
            this.lblBirthdate.TabIndex = 0;
            this.lblBirthdate.Text = null;
            this.lblBirthdate.Values.ExtraText = "";
            this.lblBirthdate.Values.Image = null;
            this.lblBirthdate.Values.Text = null;
            // 
            // txtEmail
            // 
            this.txtEmail.Location = new System.Drawing.Point(116, 141);
            this.txtEmail.Name = "txtEmail";
            this.txtEmail.Size = new System.Drawing.Size(266, 20);
            this.txtEmail.TabIndex = 7;
            // 
            // lblBirthday
            // 
            this.lblBirthday.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblBirthday.Location = new System.Drawing.Point(400, 113);
            this.lblBirthday.Name = "lblBirthday";
            this.lblBirthday.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblBirthday.ResourceKey = "";
            this.lblBirthday.ResourceModuleKey = "Birthday, TinyERP.Core";
            this.lblBirthday.Size = new System.Drawing.Size(56, 20);
            this.lblBirthday.TabIndex = 0;
            this.lblBirthday.Text = "Birthday";
            this.lblBirthday.Values.ExtraText = "";
            this.lblBirthday.Values.Image = null;
            this.lblBirthday.Values.Text = "Birthday";
            // 
            // dtBirthday
            // 
            this.dtBirthday.Culture = new System.Globalization.CultureInfo("en-US");
            this.dtBirthday.DateFormat = null;
            this.dtBirthday.InputControlStyle = ComponentFactory.Krypton.Toolkit.InputControlStyle.Standalone;
            this.dtBirthday.Location = new System.Drawing.Point(503, 114);
            this.dtBirthday.Mask = "00/00/0000";
            this.dtBirthday.Name = "dtBirthday";
            this.dtBirthday.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.dtBirthday.Size = new System.Drawing.Size(219, 20);
            this.dtBirthday.TabIndex = 8;
            this.dtBirthday.Text = "01/01/1970";
            this.dtBirthday.Value = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
            // 
            // lblUserGroup
            // 
            this.lblUserGroup.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblUserGroup.Location = new System.Drawing.Point(400, 141);
            this.lblUserGroup.Name = "lblUserGroup";
            this.lblUserGroup.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblUserGroup.ResourceKey = "";
            this.lblUserGroup.ResourceModuleKey = "UserGroup, TinyERP.Core";
            this.lblUserGroup.Size = new System.Drawing.Size(71, 20);
            this.lblUserGroup.TabIndex = 0;
            this.lblUserGroup.Text = "User group";
            this.lblUserGroup.Values.ExtraText = "";
            this.lblUserGroup.Values.Image = null;
            this.lblUserGroup.Values.Text = "User group";
            // 
            // cbUserGroup
            // 
            this.cbUserGroup.Location = new System.Drawing.Point(503, 141);
            this.cbUserGroup.Name = "cbUserGroup";
            this.cbUserGroup.Size = new System.Drawing.Size(219, 21);
            this.cbUserGroup.TabIndex = 9;
            // 
            // lblDepartment
            // 
            this.lblDepartment.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblDepartment.Location = new System.Drawing.Point(13, 167);
            this.lblDepartment.Name = "lblDepartment";
            this.lblDepartment.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblDepartment.ResourceKey = "";
            this.lblDepartment.ResourceModuleKey = "Department, TinyERP.Core";
            this.lblDepartment.Size = new System.Drawing.Size(76, 20);
            this.lblDepartment.TabIndex = 0;
            this.lblDepartment.Text = "Department";
            this.lblDepartment.Values.ExtraText = "";
            this.lblDepartment.Values.Image = null;
            this.lblDepartment.Values.Text = "Department";
            // 
            // cbDepartment
            // 
            this.cbDepartment.Location = new System.Drawing.Point(116, 167);
            this.cbDepartment.Name = "cbDepartment";
            this.cbDepartment.Size = new System.Drawing.Size(266, 21);
            this.cbDepartment.TabIndex = 10;
            // 
            // chkChangePassword
            // 
            this.chkChangePassword.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.chkChangePassword.Location = new System.Drawing.Point(503, 42);
            this.chkChangePassword.Name = "chkChangePassword";
            this.chkChangePassword.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.chkChangePassword.ResourceKey = null;
            this.chkChangePassword.ResourceModuleKey = "ChangePassword, TinyERP.Core";
            this.chkChangePassword.Size = new System.Drawing.Size(120, 20);
            this.chkChangePassword.TabIndex = 11;
            this.chkChangePassword.Text = "Change password";
            this.chkChangePassword.Values.ExtraText = "";
            this.chkChangePassword.Values.Image = null;
            this.chkChangePassword.Values.Text = "Change password";
            this.chkChangePassword.CheckedChanged += new System.EventHandler(this.OnCheckPasswordChanged);
            // 
            // lblEmail
            // 
            this.lblEmail.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblEmail.Location = new System.Drawing.Point(13, 141);
            this.lblEmail.Name = "lblEmail";
            this.lblEmail.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblEmail.ResourceKey = "";
            this.lblEmail.ResourceModuleKey = "Email, TinyERP.Core";
            this.lblEmail.Size = new System.Drawing.Size(40, 20);
            this.lblEmail.TabIndex = 12;
            this.lblEmail.Text = "Email";
            this.lblEmail.Values.ExtraText = "";
            this.lblEmail.Values.Image = null;
            this.lblEmail.Values.Text = "Email";
            // 
            // kLabel1
            // 
            this.kLabel1.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.kLabel1.Location = new System.Drawing.Point(13, 113);
            this.kLabel1.Name = "kLabel1";
            this.kLabel1.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.kLabel1.ResourceKey = "";
            this.kLabel1.ResourceModuleKey = "Phone, TinyERP.Core";
            this.kLabel1.Size = new System.Drawing.Size(45, 20);
            this.kLabel1.TabIndex = 13;
            this.kLabel1.Text = "Phone";
            this.kLabel1.Values.ExtraText = "";
            this.kLabel1.Values.Image = null;
            this.kLabel1.Values.Text = "Phone";
            // 
            // UserEditInfoForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(725, 238);
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Name = "UserEditInfoForm";
            this.ShowInTaskbar = false;
            this.Load += new System.EventHandler(this.UserEditInfoForm_Load);
            this.contentPanel.ResumeLayout(false);
            this.contentPanel.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion


		public UserEditInfoForm() : base()
		{
			InitializeComponent();
		}
		
		protected override void AddValidationRules() 
		{
			//TODO: use validator to add validation rules on your input controls
			//Example: validator.AddValidationRule(new RequiredFieldRule(txtUserName, "User name"));
            validator.AddValidationRule(new RequiredFieldRule(txtUserName, "UserName"));
		}
		
		
		
		private void PrepareData() 
		{
			LoadDataOfUserGroup();
			LoadDataOfDepartment();
		}
		
		private void LoadDataOfUserGroup() 
		{
			long totalRecord = 0;
            IList userGroupList = UserGroupService.GetAllUserGroup("ID", Bamboo.Core.Data.SortDirection.ASCENDING, out totalRecord);
            
            cbUserGroup.ValueMember = "ID";
            cbUserGroup.DisplayMember = "Name";
            cbUserGroup.DataSource = userGroupList; 
		}
		private void LoadDataOfDepartment() 
		{
			long totalRecord = 0;
            IList departmentList = DepartmentService.GetAllDepartment("ID", Bamboo.Core.Data.SortDirection.ASCENDING, out totalRecord);
            
            cbDepartment.ValueMember = "ID";
            cbDepartment.DisplayMember = "Name";
            cbDepartment.DataSource = departmentList; 
		}
		protected override void LoadEntityInfo() 
		{
			PrepareData();
		    if(user==null) 
		    {
				user = new UserDTO();
		    }
           
			txtUserName.Text = user.UserName;
			
			txtFullName.Text = user.FullName;
			txtAddress.Text = user.Address;
			txtPhone.Text = user.Phone;
            if (user.Birthdate != null)
            {
                dtBirthday.Value = user.Birthdate.Value;
            }
			txtEmail.Text = user.Email;
			
			cbUserGroup.SelectedValue = user.UserGroupID;
			cbDepartment.SelectedValue = user.DepartmentID;
			deleteButton.Visible = AllowDelete && (user.ID != 0) ;
            chkChangePassword.Visible = this.IsEditMode;
            txtPassword.Enabled = !IsEditMode;
            if (!txtPassword.Enabled)
            {
                txtPassword.Text = FAKE_PASSWORD;
            }
		}
       
		protected override bool ValidateInputData() 
		{
            if (!base.ValidateInputData()) 
			{
				return false;
			}
            if (UserService.CheckUserExist(txtUserName.Text, user.ID))
            {
                MessageBoxHelper.ShowError(ModuleResourceManager.GetInstance().GetStringFromModuleResourceKey("MsgUserExist, TinyERP.Core"));
                txtUserName.Focus();
                return false;
            }
            if (cbUserGroup.SelectedValue == null)
            {
                MessageBoxHelper.ShowError(ModuleResourceManager.GetInstance().GetStringFromModuleResourceKey("MsgUserGroupRequire, TinyERP.Core"));
                cbUserGroup.Focus();
                return false;
            }
			return true;
		}
		
		private bool UpdateEntityInfoFromInput() 
		{
			if(!ValidateInputData()) 
			{
				return false;
			}
			user.UserName = txtUserName.Text;
            if (txtPassword.Enabled)
            {
                user.RawPassword = txtPassword.Text;
            }
			user.FullName = txtFullName.Text;
			user.Address = txtAddress.Text;
			user.Phone = txtPhone.Text;
			user.Birthdate = dtBirthday.Value;
			user.Email = txtEmail.Text;
			
			if(cbUserGroup.SelectedValue != null) 
			{
				user.UserGroupID = (long) cbUserGroup.SelectedValue;
			}
			if(cbDepartment.SelectedValue != null) 
			{
				user.DepartmentID = (long) cbDepartment.SelectedValue;
			}
			return true;
		}
        
        public override void OnSave()
        {
			if(!UpdateEntityInfoFromInput()) 
			{
				return;
			}
			try {
				if(user.ID==0) 
				{
					UserService.SaveUser(user);
				}
				else 
				{
					UserService.UpdateUser(user);
				}
				MessageBox.Show(CommonMessage.GetSaveSuccessMessage(GetEntityResourceKey()));
                InvokeOnNeedReloadData();
                InvokeCloseDialog();
			} 
			catch(Exception ex) 
			{
				logger.Error(ex);			
				MessageBox.Show(CommonMessage.GetCanNotSaveError(GetEntityResourceKey()));
			}
        }

        public override void OnDelete()
        {
			try 
			{
                if (ConfirmDelete() == DialogResult.OK)
                {
					UserService.DeleteUserByID(user.ID);			
					MessageBox.Show(CommonMessage.GetDeleteSuccessMessage(GetEntityResourceKey()));
                    InvokeOnNeedReloadData();
                    InvokeCloseDialog();
				}
			}
			catch(Exception ex) 
			{
                logger.Debug(ex);			
				MessageBox.Show(CommonMessage.GetCanNotDeleteError(GetEntityResourceKey()));
			}
        }

        
        public override string GetHeaderText()
        {
            return ModuleResourceManager.GetInstance().GetStringFromModuleResourceKey("UserEditForm, TinyERP.Core");
        }

        private string GetEntityResourceKey()
        {
            return ModuleResourceManager.GetInstance().GetStringFromModuleResourceKey("User, TinyERP.Core");
        }

        private DialogResult ConfirmDelete()
        {
            return MessageBox.Show(CommonMessage.GetDeleteConfirmMessage(GetEntityResourceKey()),
                CommonMessage.GetConfirmationText(), MessageBoxButtons.OKCancel);
        }

        private void OnCheckPasswordChanged(object sender, EventArgs e)
        {
            txtPassword.Enabled = chkChangePassword.Checked;
            if (txtPassword.Enabled)
            {
                txtPassword.Text = "";
                txtPassword.Focus();
            }
            else
            {
                txtPassword.Text = FAKE_PASSWORD;
            }
        }

        private void UserEditInfoForm_Load(object sender, EventArgs e)
        {
            LoadEntityInfo();
        }

	}
}

